/**
 * Copyright 2010 Creative Works, Inc.
 * Creative Works licenses this file to you under the Apache License, version
 * 2.0 (the "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *    http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.  See the License for the specific language governing
 * permissions and limitations under the License.
 */
package org.sendvox.freswitch.core.impl;

import org.sendvox.freswitch.core.ApiCommand;
import org.sendvox.freswitch.core.EventCommand;
import org.sendvox.freswitch.core.SendMsg;
import org.sendvox.freswitch.core.SendvoxFactory;
import org.sendvox.freswitch.inbound.InboundClient;
import org.sendvox.freswitch.inbound.impl.InboundClientImpl;
import org.sendvox.freswitch.outbound.OutboundClient;
import org.sendvox.freswitch.outbound.impl.OutboundClientImpl;

public class SendvoxFactoryImpl implements SendvoxFactory {

	private static SendvoxFactoryImpl theSendvoxFactory;

	/**
	 * Creates the default factory implementation.
	 */
	public static SendvoxFactory init() {
		if (theSendvoxFactory != null) {
			return theSendvoxFactory;
		}
		return new SendvoxFactoryImpl();
	}

	private SendvoxFactoryImpl() {

	}

	@Override
	public InboundClient createInboundClient() {
		InboundClientImpl inboundClient = new InboundClientImpl();
		return inboundClient;
	}

	@Override
	public SendMsg createSendMsg() {
		SendMsg sendMsg = new SendMsgImpl();
		return sendMsg;
	}

	@Override
	public ApiCommand createApiCommand() {
		ApiCommand apiCommand = new ApiCommandImpl();
		return apiCommand;
	}

	@Override
	public EventCommand createEventCommand() {
		EventCommand eventCommand = new EventCommandImpl();
		return eventCommand;
	}

	@Override
	public OutboundClient createOutboundClient() {
		OutboundClientImpl outboundClient = new OutboundClientImpl();
		return outboundClient;
	}

}
